//
// Created by ole on 24-8-27.
//

#ifndef BASEPLUGINWRAPPER_H
#define BASEPLUGINWRAPPER_H
#include <string>

#include "BasePlugin.h"
#include "PluginLoader.h"


class PluginWrapper {
public:
    explicit PluginWrapper(std::string path);

    explicit PluginWrapper(const std::shared_ptr<BasePlugin> &basePlugin);

    ~PluginWrapper();

    bool initPlugin(const std::shared_ptr<IPCManager> &ipcManager);

    std::shared_ptr<BasePlugin> getPlugin() const;

    std::string getName() const;

    bool start() const;

    void stop() const;

private:
    void *handle{};
    std::string path;
    static PluginLoader loader;
    std::shared_ptr<BasePlugin> basePlugin;
};


#endif //BASEPLUGINWRAPPER_H
